package com.xes.rabbitmq.producte.controller;

import com.xes.rabbitmq.core.domain.tables.pojos.TbStudent;
import com.xes.rabbitmq.producte.service.StudentSenderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AckSenderController {

    @Autowired
    private StudentSenderService studentSenderService;

    @RequestMapping(value = "s")
    public String ackSender(String messageId) {
        TbStudent student = new TbStudent();
        student.setId(String.valueOf(messageId));
        student.setName("学员" + messageId + "号");
        studentSenderService.createStudent(student, messageId);
        return messageId;
    }
}
